package com.cq.service.impl;

import com.cq.mapper.RoomMapper;
import com.cq.pojo.Room;
import com.cq.service.RoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 悠久的苍穹
 * @Date: 2021/1/27 17:04
 * @Description: ${description}
 * @Version: 1.0
 */
@Service
public class RoomServiceImpl implements RoomService {

    @Autowired
    RoomMapper roomMapper;

    @Override
    public int getCount() {
        return roomMapper.getCount();
    }

    @Override
    public List<Room> findAllRoom(int page, int limit) {
        return roomMapper.findAllRoom((page-1)*limit,limit);
    }

    @Override
    public Room findRoomById(String id) {
        return roomMapper.findRoomById(id);
    }

    @Override
    public void deleteRoomById(int id) {
        roomMapper.deleteRoomById(id);
    }

    @Override
    public int getWebCount() {
        return roomMapper.getWebCount();
    }

    @Override
    public List<Room> findAllWebRoom(int page, int limit) {
        return roomMapper.findAllWebRoom(page,limit);
    }
}
